package com.cy.springboot04notice.web.configuration;

import com.cy.springboot04notice.web.interceptor.TimeAccessInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class SpringWebConfig implements WebMvcConfigurer {

    public void addInterceptors(InterceptorRegistry registry){
        // /notice/**必须写两个**，因为若要在地址上写参数则第二个*指参数(http://localhost/notice/dodeleteById/?idss=15)
        registry.addInterceptor(new TimeAccessInterceptor()).addPathPatterns("/notice/dofindById");
    }
}
